import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParkShopEmployeeVO, ParkShopEmployeeForm, ParkShopEmployeeQuery } from '@/api/park/parkShopEmployee/types';

/**
 * 查询店铺员工列表
 * @param query
 * @returns {*}
 */

export const listParkShopEmployee = (query?: ParkShopEmployeeQuery): AxiosPromise<ParkShopEmployeeVO[]> => {
  return request({
    url: '/park/parkShopEmployee/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询店铺员工详细
 * @param employeeId
 */
export const getParkShopEmployee = (employeeId: string | number): AxiosPromise<ParkShopEmployeeVO> => {
  return request({
    url: '/park/parkShopEmployee/' + employeeId,
    method: 'get'
  });
};

/**
 * 新增店铺员工
 * @param data
 */
export const addParkShopEmployee = (data: ParkShopEmployeeForm) => {
  return request({
    url: '/park/parkShopEmployee',
    method: 'post',
    data: data
  });
};

/**
 * 修改店铺员工
 * @param data
 */
export const updateParkShopEmployee = (data: ParkShopEmployeeForm) => {
  return request({
    url: '/park/parkShopEmployee',
    method: 'put',
    data: data
  });
};

/**
 * 删除店铺员工
 * @param employeeId
 */
export const delParkShopEmployee = (employeeId: string | number | Array<string | number>) => {
  return request({
    url: '/park/parkShopEmployee/' + employeeId,
    method: 'delete'
  });
};
